﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using DevExpress.XtraGrid.Views.Grid;

namespace CIIS.Common
{
    public partial class BaseGridView : GridView
    {
        public BaseGridView()
        {
            InitializeComponent();

            IndicatorWidth = 20;
            CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(BaseGridView_CustomDrawRowIndicator);

            //不显示分组
            OptionsView.ShowGroupPanel = false;

            //不允许其它列操作
        }

        void BaseGridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (e.Info.IsRowIndicator && e.RowHandle >= 0)
            {
                e.Info.DisplayText = (e.RowHandle +1).ToString();
            }
        }

        public BaseGridView(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }
    }
}
